import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
    mode: "history", // 或 "hash"
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: "/home",      // 路由路径，和 push 中的字符串对应
            name: "Home",       // 路由名称（可选）
            component: () => import("../views/UserHome.vue") // 路由组件，按需加载
        },
        {
            path: "/login",
            name: "Login",
            component: () => import("../views/UserLogin.vue")
        },
        {
            path: "/editor",
            name: "Editor",
            component: () => import("../views/UserEditor.vue")
        },
        {
            path: "/register",
            name: "Register",
            component: () => import("../views/UserRegister.vue")
        }
    ]
});
